home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$TreeHomeAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.3 KB  |  76 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5. import javax.swing.tree.TreePath;
  6.  
  7. public class BasicTreeUI$TreeHomeAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.    protected int direction;
  11.    private boolean addToSelection;
  12.    private boolean changeSelection;
  13.  
  14.    public BasicTreeUI$TreeHomeAction(BasicTreeUI var1, int var2, String var3) {
  15.       this(var1, var2, var3, false, true);
  16.    }
  17.  
  18.    private BasicTreeUI$TreeHomeAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5) {
  19.       this.this$0 = var1;
  20.       this.direction = var2;
  21.       this.changeSelection = var5;
  22.       this.addToSelection = var4;
  23.    }
  24.  
  25.    // $FF: synthetic method
  26.    BasicTreeUI$TreeHomeAction(BasicTreeUI var1, BasicTreeUI.1 var2, int var3, String var4, boolean var5, boolean var6) {
  27.       this(var1, var3, var4, var5, var6);
  28.    }
  29.  
  30.    public void actionPerformed(ActionEvent var1) {
  31.       int var2 = this.this$0.getRowCount(this.this$0.tree);
  32.       if (this.this$0.tree != null && var2 > 0) {
  33.          if (this.direction == -1) {
  34.             this.this$0.ensureRowsAreVisible(0, 0);
  35.             if (this.addToSelection) {
  36.                TreePath var3 = BasicTreeUI.access$9(this.this$0);
  37.                int var4 = var3 == null ? -1 : this.this$0.getRowForPath(this.this$0.tree, var3);
  38.                if (var4 == -1) {
  39.                   this.this$0.tree.setSelectionInterval(0, 0);
  40.                } else {
  41.                   this.this$0.tree.setSelectionInterval(0, var4);
  42.                   BasicTreeUI.access$2(this.this$0, var3);
  43.                   BasicTreeUI.access$3(this.this$0, this.this$0.getPathForRow(this.this$0.tree, 0));
  44.                }
  45.             } else if (this.changeSelection) {
  46.                this.this$0.tree.setSelectionInterval(0, 0);
  47.             } else {
  48.                BasicTreeUI.access$6(this.this$0, this.this$0.getPathForRow(this.this$0.tree, 0), true);
  49.             }
  50.          } else {
  51.             this.this$0.ensureRowsAreVisible(var2 - 1, var2 - 1);
  52.             if (this.addToSelection) {
  53.                TreePath var5 = BasicTreeUI.access$9(this.this$0);
  54.                int var6 = var5 == null ? -1 : this.this$0.getRowForPath(this.this$0.tree, var5);
  55.                if (var6 == -1) {
  56.                   this.this$0.tree.setSelectionInterval(var2 - 1, var2 - 1);
  57.                } else {
  58.                   this.this$0.tree.setSelectionInterval(var6, var2 - 1);
  59.                   BasicTreeUI.access$2(this.this$0, var5);
  60.                   BasicTreeUI.access$3(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var2 - 1));
  61.                }
  62.             } else if (this.changeSelection) {
  63.                this.this$0.tree.setSelectionInterval(var2 - 1, var2 - 1);
  64.             } else {
  65.                BasicTreeUI.access$6(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var2 - 1), true);
  66.             }
  67.          }
  68.       }
  69.  
  70.    }
  71.  
  72.    public boolean isEnabled() {
  73.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  74.    }
  75. }
  76.